<!DOCTYPE html>
<html>
<head>
    <title>文件操作日志</title>
    <#include "/header.html">


</head>
<body>

<div id="rrapp" v-cloak>
<!--	<div style="width: 100%; margin-bottom: 25px;">-->
<!--		<div class="form-group col-sm-2" style="padding: 0!important;"><input type="text" placeholder="文件名称" class="form-control"></div>-->
<!--		<a class="btn btn-default" style="margin-left: 10px;">查询</a>-->
<!--		<a class="btn btn-default" style="margin-left: 10px;">清空</a>-->
<!--	</div>-->
    <div v-show="showList">
        <div class="grid-btn">

            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.fileName" @keyup.enter="query" placeholder="文件名称、操作人、操作类型">
            </div>
            <div class="form-group col-sm-1">
                <input type="text" class="form-control " v-model="q.startTime" @keyup.enter="query" id="test1" placeholder="开始时间" readonly>
            </div>
            <div class="form-group col-sm-1">
                <input type="text" class="form-control " v-model="q.endTime" @keyup.enter="query" id="test2"  placeholder="结束时间" readonly>
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <#if shiro.hasPermission("file:operlog:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
            <#if shiro.hasPermission("file:operlog:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("file:operlog:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>

<div v-show="!showList" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">文件名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="operLog.fileName" placeholder="文件名称"/>
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <div class="col-sm-2 control-label">文件大小</div>-->
<!--            <div class="col-sm-10">-->
<!--                <input type="text" class="form-control" v-model="operLog.size" placeholder="文件大小"/>-->
<!--            </div>-->
<!--        </div>-->


        <div class="form-group">
            <div class="col-sm-2 control-label">操作类型</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="operLog.type" placeholder="操作类型"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">操作人</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="operLog.operUserName" placeholder="操作人"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">创建时间</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="operLog.creatTime" placeholder="创建时间"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..."
                   @click="saveOrUpdate" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
        </div>
    </form>
</div>
</div>

<script>
    // var fileUrl = "http%3A%2F%2Flocalhost%3A8012%2Fdemo%2F新建%20Microsoft%20Word%20文档.docx";
    // // var url = "http://localhost:8012/picturesPreview?url=" + encodeURIComponent(fileUrl);
    //
    // var url = "http://localhost:8012/onlinePreview?url=http%3A%2F%2Flocalhost%3A8012%2Fdemo%2F%E6%96%B0%E5%BB%BA%20Microsoft%20Word%20%E6%96%87%E6%A1%A3.docx";
    // var winHeight = window.document.documentElement.clientHeight-10;
    // // console.log("杜兰特");
    // // window.open(url, "_blank", "height=" + winHeight
    // //     + ",top=80,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes");
    //
    // window.open(url);


    // var fileUrl =url1+"|"+"url2";//多文件使用“|”字符隔开
    // var url = "http://localhost:8012/picturesPreview?urls" + encodeURIComponent(fileUrl);
    // var winHeight = window.document.documentElement.clientHeight-10;
    // $window.open(url, "_blank", "height=" + winHeight
    //     + ",top=80,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes");


</script>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
        laydate.render({
            elem: '#test2' //指定元素
        });
    });
</script>
<script src="${request.contextPath}/statics/js/modules/file/operlog.js?_${.now?long}"></script>
</body>
</html>